DBM is a method to index data between two files with a hash key. Each record in the table has a unique hash key. This database methodology has been used for simple tables for many years, and is available on hundreds of different platforms. DBM is just a framework where one hash key is matched with one data field in another file. For instance, if a database full of names is desired, the hash key could be the last name. When a user types in “Miller”, for instance, a unique record for Miller is returned. The DBM framework is a one-to-one system, i.e., there is one key for one record.
The hash keys are in a hash table, and the data are just static records in a data file. Technically one could take the data file on its own with DBM and traverse it similar to the way one would traverse a flat file. The only difference between a DBM data file and the flat file is that the DBM data file has an index in another file that identified the offset of where to go to retrieve the data. A DBM file is just another way to access the data without having to use a whole database management system like Oracle® or Sybase®.
There are several database solutions today that extend DBM files, for instance Berkeley DB 1.85 and MySQL 3.23. Further information about Berkeley DB may be found at http://www.sleepycat.com and more information about MySQL can be found at http://www.mysql.com. Each of these systems has its advantages and disadvantages.
With the Berkley DB solution, the engine acts as a transport for the key/value pair. Indexing within the data area is not allowed, but can be accomplished using additional software. There are advantages with this method, i.e. abstraction of data, and de-referenced data types. Disadvantages include the following. The application must provide the interpretation for the data; it is not supplied directly. The Berkley DB process does not implement SQL, but is documented as an extension to the DBM hashing algorithm. If SQL is desired, it must be implemented as an additional layer. Searching is limited to the key and value pair, not regular expression matching is available directly. Since the distribution is a collection of C libraries, the source must be compiled for each platform. No binary distribution is known to be available as of the date of this writing.
MySQL requires the use of a database management server to handle the transactions. This server is responsible for managing all data transfer to and from the tables. The user of the server requires more technical knowledge from the administrator. It also requires specific processes to ensure that it initializes correctly and remains active after a system restart. MySQL installation is more complex and varies for each platform. Configuration files must be reviewed and edited. MySQL requires more than a basic knowledge of the internal processes to maintain data integrity. MySQL does support SQL, does not support regular expression matching on all fields defined in the table. MySQL requires the application developer to define the data types and sizes. MySQL trims string columns of trailing spaces.